package cn.wit.front.controller;

import cn.wit.front.condition.BaoyanCondition;
import cn.wit.front.service.BaoyanService;
import cn.wit.utils.pojo.Baoyan;
import cn.wit.utils.response.Result;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/baoyan")
@CrossOrigin
@Api(tags = "保研管理")
public class BaoyanController {
    @Autowired
    private BaoyanService baoyanService;


    @GetMapping("/searchBaoyan/{num}/{size}")
    @ApiOperation("搜索保研信息")
    public Result insertBaoyan(@PathVariable("num") int num,
                               @PathVariable("size") int size, BaoyanCondition condition) {
        IPage<Baoyan> page = new Page<>(num, size);
        return baoyanService.searchBaoyan(page, condition);
    }
}
